#include "ExpressionType.hpp"

unsigned int
getTypeSize ( const Type& type )
{
    unsigned int size = 0;
    if ( type._modifier == POINTER )
        return sizeof ( void* );
    switch ( type._base )
    {
    case INTEGER:
        size = sizeof ( int );
        break;
    case REAL:
        size = sizeof ( float );
        break;
    case BOOLEAN:
        size = sizeof ( bool );
        break;
    default:
        break;
    }
    if ( type._modifier == ARRAY )
        size *= type._size;
    return size;
}

